<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">


    <h:body>
        <ui:composition>
            <h:form id="formMenu">


                <p:toolbar >
                    <p:toolbarGroup >
                        <p:commandButton id="botaoHome" type="push" value="Home" ajax="false" image="ui-icon-home" action="/pages/protected/home.xhtml"/>
                        <p:menuButton value="Cadastro" >
                            <p:menuitem id="botaoAssociado2"  type="push" value="Associado" ajax="false" image="ui-icon-wrench" action="associados" />
                            <p:menuitem id="botaoAssociado3"  type="push" value="Associado" ajax="false" image="ui-icon-wrench" action="#{associadoMB.prepararAdicionar}" />
                            <p:menuitem id="botaoEmpresa2"  type="push" value="Empresa" ajax="false" image="ui-icon-wrench" action="empresaLista?faces-redirect=true" />
                            <p:menuitem id="botaoEmpresa"  type="push" value="Empresa" ajax="false" image="ui-icon-wrench" action="#{empresaController.prepararAdicionar()}"/>
                        </p:menuButton>
                        
                        <p:menuButton value="Lançamentos" rendered="#{applicationController.currentUser.solicitante or applicationController.currentUser.chefe}">
                            
                        </p:menuButton>
                        
                        <p:menuButton value="Relatórios" rendered="#{applicationController.currentUser.solicitante or applicationController.currentUser.chefe}">
                            
                        </p:menuButton>
                        
                        <p:commandButton id="botaoUsuario" rendered="#{applicationController.currentUser.chefe}" type="push" value="Usuário" ajax="false" image="ui-icon-person" action="usuarioLista?faces-redirect=true"/>
                        <p:commandButton id="botaoLocal" rendered="#{applicationController.currentUser.chefe}" type="push" value="Local" ajax="false" image="ui-icon-image" action="localLista?faces-redirect=true"/>
                        <p:commandButton id="botaoManutencao" rendered="#{applicationController.currentUser.solicitante or applicationController.currentUser.chefe}" type="push" value="Solicitar Manutenção" ajax="false" image="ui-icon-wrench" action="#{solicitacaoController.prepararAdicionar()}"/>
                        <p:commandButton id="botaoAssociado" rendered="#{applicationController.currentUser.solicitante or applicationController.currentUser.chefe}" type="push" value="Associado" ajax="false" image="ui-icon-wrench" action="associadoLista?faces-redirect=true"/>
                        <p:commandButton id="botaoConsultaPatrimonio" rendered="#{applicationController.currentUser.chefe}" type="push" value="Consultar por Patrimônio" ajax="false" image="ui-icon-tag" action="patrimonioConsulta?faces-redirect=true"/>
                        
                        <p:commandButton id="botaoLogout" type="push" ajax="false" value="#{bundle.logOut}" action="#{userMB.logOut()}" image="ui-icon-power" />
                        
                    </p:toolbarGroup>
                    <p:toolbarGroup  align="right">                                                              
                        <h:outputText style="margin: 7px 5px 0 0; display: block;" value="#{applicationController.currentUser.nome}" />
                    </p:toolbarGroup>
                </p:toolbar>

            </h:form>


        </ui:composition>
    </h:body>
</html>

